/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Keith Augustsson
 */
@Embeddable
public class OtherflightsPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "airline")
    private String airline;
    @Basic(optional = false)
    @Column(name = "flight")
    private String flight;

    public OtherflightsPK(String airline, String flight) {
        this.airline = airline;
        this.flight = flight;
    }

    public String getAirline() {
        return airline;
    }

    public void setAirline(String airline) {
        this.airline = airline;
    }

    public String getFlight() {
        return flight;
    }

    public void setFlight(String flight) {
        this.flight = flight;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (airline != null ? airline.hashCode() : 0);
        hash += (flight != null ? flight.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OtherflightsPK)) {
            return false;
        }
        OtherflightsPK other = (OtherflightsPK) object;
        if ((this.airline == null && other.airline != null) || (this.airline != null && !this.airline.equals(other.airline))) {
            return false;
        }
        if ((this.flight == null && other.flight != null) || (this.flight != null && !this.flight.equals(other.flight))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.OtherflightsPK[airline=" + airline + ", flight=" + flight + "]";
    }

}
